Skip to content

ATLAS-5373: Atlas React UI: Extremely long entity names break layout in Latest Entities Created widget - #728

Open
Brijesh619 wants to merge 5 commits into
apache:masterfrom
Brijesh619:ATLAS-5373
Open

ATLAS-5373: Atlas React UI: Extremely long entity names break layout in Latest Entities Created widget#728
Brijesh619 wants to merge 5 commits into
apache:masterfrom
Brijesh619:ATLAS-5373

Conversation

@Brijesh619

@Brijesh619 Brijesh619 commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

ATLAS-5373: Atlas React UI: Refactor and stabilize layout in Latest Entities Created widget

This PR fixes styling, layout, and type-safety bugs in the "Latest Entities Created" widget and its underlying shared components. It migrates away from inline sx objects to strict, maintainable SCSS classes, and drastically improves the performance, layout resilience, and type safety of shared UI components.

  • Strict SCSS & Layout Hardening: Removed inline sx styles across the LatestEntitiesList component and migrated them to LatestEntitiesList.scss. Hardened flex layout rules (flex: 1 1 auto; min-width: 0) and added flex-shrink: 0 / max-width: 45% constraints on .latest-entities-type-wrapper to prevent long entity names from squishing the type label down to an isolated ( character.
  • Intelligent & Consistent Truncation: Implemented the OverflowTooltip component to elegantly handle long entity and type names. Added explicit CSS truncation rules (overflow: hidden, text-overflow: ellipsis, white-space: nowrap, min-width: 0) directly to .latest-entities-type-name in SCSS alongside OverflowTooltip for guaranteed visual consistency.
  • Tooltip & Component Enhancements: Upgraded OverflowTooltip in muiComponents.tsx to use ResizeObserver (combined with an onMouseEnter fallback) for accurate DOM boundary detection. Added inline documentation clarifying the per-instance observer pattern trade-offs.
  • Global Type-Safety Refactor:
    • Refactored LightTooltip in muiComponents.tsx to strictly use TooltipProps instead of any.
    • Completely refactored CustomButton to enforce native @mui/material/ButtonProps, eliminating legacy any escape hatches. Proactively cleaned up invalid props and event handlers across downstream consumers to guarantee 100% type safety.
  • UX & Code Cleanup: Restored the "Created " prefix on relative timestamps to maintain UX expectations and cleaned up formatting/blank line inconsistencies between helpers and component definitions.

How was this patch tested?

  • Manual UI Testing: Verified in the dashboard that extremely long entity names cleanly truncate with an ellipsis ..., long type names remain appropriately visible without collapsing into (, and tooltips appear precisely when fractional overflow occurs.
  • Unit Tests:
    • Reverted assertions in LatestEntitiesList.test.tsx back to strict /^Created / regex matchers (lines 190, 331, 537, 603) for strong regression protection.
    • Added a dedicated unit test for extremely long typeName ('B'.repeat(300)) verifying robust rendering without layout breakdown.
    • Strongly typed test mocks (triggerResize: ResizeObserverCallback) in muiComponents.test.tsx.
    • All unit tests pass cleanly (npm run test).
  • TypeScript & ESLint Validation: Passed strict type checking (npm run typecheck) across the entire dashboard with zero errors.

@Brijesh619

Copy link
Copy Markdown
Contributor Author
Screenshot from 2026-08-17 12-11-36 Screenshot from 2026-08-17 12-08-37 Screenshot from 2026-08-17 12-08-25

Comment thread dashboard/src/views/DashboardOverview/LatestEntitiesList.tsx Outdated
Comment thread dashboard/src/components/muiComponents.tsx Outdated
Comment thread dashboard/src/components/muiComponents.tsx Outdated
Comment thread dashboard/src/components/muiComponents.tsx Outdated
Comment thread dashboard/src/components/__tests__/muiComponents.test.tsx
Comment thread dashboard/src/views/DashboardOverview/LatestEntitiesList.scss Outdated
Comment thread dashboard/src/views/DashboardOverview/LatestEntitiesList.tsx Outdated
Comment thread dashboard/src/components/muiComponents.tsx Outdated
Comment thread dashboard/src/components/muiComponents.tsx Outdated
@Brijesh619

Copy link
Copy Markdown
Contributor Author
Screenshot from 2026-08-21 14-50-14

Comment thread dashboard/src/views/DashboardOverview/LatestEntitiesList.tsx Outdated
Comment thread dashboard/src/views/DashboardOverview/LatestEntitiesList.scss
Comment thread dashboard/src/views/DashboardOverview/LatestEntitiesList.tsx Outdated
@Brijesh619

Copy link
Copy Markdown
Contributor Author
Screenshot from 2026-08-24 15-22-47

@Brijesh619

Copy link
Copy Markdown
Contributor Author
Screenshot from 2026-08-24 15-24-49

Comment thread dashboard/src/components/muiComponents.tsx Outdated
Comment thread dashboard/src/components/__tests__/muiComponents.test.tsx Outdated
Comment thread dashboard/src/views/DashboardOverview/LatestEntitiesList.scss Outdated
Comment thread dashboard/src/components/muiComponents.tsx
Comment thread dashboard/src/views/DashboardOverview/__tests__/LatestEntitiesList.test.tsx Outdated
Comment thread dashboard/src/views/DashboardOverview/LatestEntitiesList.scss
Comment thread dashboard/src/views/DashboardOverview/LatestEntitiesList.tsx Outdated
@Brijesh619

Copy link
Copy Markdown
Contributor Author
Screenshot from 2026-09-03 15-55-58 Screenshot from 2026-09-03 15-54-40

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants